Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow the agent to run in environments with read-only filesystems #2085

Merged
merged 9 commits into from
Nov 21, 2023

Conversation

nr-ahemsath
Copy link
Member

Description

This PR contains a set of features intended to make it possible and more convenient to use the agent in environments with read-only filesystems:

  • The agent will continue to operate and report data to New Relic even if it can't create log files
  • A configuration option is added to disable file logging entirely
  • Console logging can be enabled for the profiler, and is more convenient to enable for the agent via an environment variable

nr-ahemsath and others added 6 commits September 21, 2023 15:47
* New option to disable logging
* Env var for console logging
* Supportability metric if logging fails
* Don't allow audit logging if logging is disabled
…nabled (#2076)

* Checkpoint in order to switch branches

* Refactored AgentLogFile

Moved AgentLogFile to the fixtures instead of the applications

* Shorten some names

* Fix bug caused by Visual Studio autocorrect

* WIP

* Working tests for logging disabled

* Working console logging tests

* Fix nuget package warnings-as-errors

* Fix GuidConfigurationTests

EndsWith() fails if the profiler logs the version, e.g. New Relic .NET CoreCLR Agent v10.18.0.26.  Use Contains() instead
@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2023

Codecov Report

Merging #2085 (0a3c69a) into main (9e355f3) will increase coverage by 0.03%.
The diff coverage is 78.26%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2085      +/-   ##
==========================================
+ Coverage   81.05%   81.09%   +0.03%     
==========================================
  Files         395      395              
  Lines       24695    24711      +16     
  Branches     2966     2969       +3     
==========================================
+ Hits        20017    20039      +22     
+ Misses       3891     3888       -3     
+ Partials      787      784       -3     
Files Coverage Δ
...elic/Agent/Core/AgentHealth/AgentHealthReporter.cs 84.89% <100.00%> (+0.33%) ⬆️
.../NewRelic/Agent/Core/Config/ConfigurationLoader.cs 82.83% <100.00%> (+0.05%) ⬆️
...c/Agent/Core/Configuration/ConfigurationService.cs 92.42% <100.00%> (ø)
...c/Agent/Core/Configuration/DefaultConfiguration.cs 88.45% <100.00%> (+<0.01%) ⬆️
.../Agent/Core/Configuration/ReportedConfiguration.cs 99.06% <100.00%> (+<0.01%) ⬆️
...c/Agent/NewRelic/Agent/Core/Metrics/MetricNames.cs 91.86% <ø> (ø)
src/NewRelic.Core/Logging/Log.cs 80.00% <ø> (ø)
.../NewRelic/Agent/Core/Logging/LoggerBootstrapper.cs 76.25% <37.50%> (-2.24%) ⬇️

... and 2 files with indirect coverage changes

@nr-ahemsath nr-ahemsath merged commit 09ab29d into main Nov 21, 2023
71 checks passed
@nr-ahemsath nr-ahemsath deleted the feature/read-only-file-systems branch November 21, 2023 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants